How to link
You add audio to your web page by linking to it: My Favorite Tune This page explains how you can have more fine-grained control over the player by using standard attributes of the (anchor) element, like this: my favorite song Anchor Element Attributes href: : A URL for an audio file. For example: a song type: : The MIME type of the file. If this is an audio file type, Yahoo! Media Player will know that the link is playable. For example: a song tabindex: : By default, tracks are loaded into the player in document order, meaning the order in which they appear to the HTML parser. To override this default order you can use the tabindex attribute. See the HTML specification for details. For music: second songfirst song title: : The "title" attribute can be used to specify the audio file's name. For artist: a song class="htrack": : Explicitly marks audio that should be added to the play queue. For music: a song Playable Links You tell the music player which links are playable using one of these methods: # Use a file extension that suggests a playable file type: this is a song # Use the type attribute to hint that the file type is playable: this is a song If the type attribute is set, the music player ignores the file extension. In this example, the link would be considered playable: this is a song And in this example, the link would not be considered playable: this is a song # Give the link the class "htrack", like this: this is a song If the htrack class is set, the music player includes the link, regardless of the file extension or the type attribute. In this example, the link would be considered playable: this is a song If the htrack class is set on any link, then only links with the htrack class set will ever be used. NOTE: Even if the "htrack" class is used to indicate whether or not to include a given link, the file extension and/or type attribute are still used to determine which underlying player technology to use. If the most appropriate player technology can not be determined, the default, or "catch-all" technology will be used. In some cases, this may result in the Yahoo! Media Player only playing back the first 30 seconds of the song. So, if your link has a file extension that does not accurately indicate the type of media it represents, go ahead and use the type attribute, even in conjunction with the "htrack" class. Album Art You can set the image which is displayed in the player during a song. To do this, put an img element within the playable link. For example: my song The dimensions of the image should be square, not rectangular. If you don't want the image to show up directly in the main web page, add style="display:none" to your img tag: my song Playlists An easy way to add an entire playlist and all the song metadata to your page is to link to an XSPF file. For example: My Favorite Playlist Similarly to the way it works with tracks, you can use the "type" attribute to indicate that a link should be treated as a playlist, when the file extension is not ".xspf." If the link has a ".xspf" file extension, use of the type attribute is unnecessary. Here is a sample file: http://example.com/song.mp3 Song Title Artist Album http://example.com/art.jpg These are the main XSPF fields that you need to know about: location: : The URL to the audio file. title: : Name of the song, title of the podcast episode, etc. creator: : Name of the person or entity that authored the work. For a song this would be the composer. album: : Name of the album, CD or compilation that the work is from, if any. image: : URL for an image to use as album art in the player while the media is rendering. Dimensions should be square, not rectangular. * Tip: your playlist does *NOT* have to be hosted on the same-origin security policy, but it does have to be accessible to anybody on the open web. Link hiding To conceal links from the user, see Link hiding